package com.spzx.channel.controller;

import com.spzx.channel.domain.ItemVo;
import com.spzx.channel.service.IIndexService;
import com.spzx.channel.service.IItemService;
import com.spzx.common.core.web.controller.BaseController;
import com.spzx.common.core.web.domain.AjaxResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Tag(name = "首页管理")
@RestController
@RequestMapping(value = "/item")
public class ItemController extends BaseController {

    @Resource
    private IItemService itemService;

    //首页数据
    @GetMapping("{skuId}")
    public AjaxResult item(@PathVariable Long skuId) {
        Long start = System.currentTimeMillis();
        ItemVo itemVo = itemService.item(skuId);
        long end = System.currentTimeMillis();
        System.out.println("测试接口时长为" + (end - start));
        return success(itemVo);
    }

}